home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / disk / misc / CltdUtils.lha / Inquire.asm < prev    next >
Encoding:
Assembly Source File  |  1990-05-24  |  14.0 KB  |  569 lines

  1. *****************************************************************************
  2. *  Program:  Inquire.asm V1.0 - ©1990 by Jeff Lavin
  3. *  Descrip:  Checking for Devices on the SCSI bus.
  4. *    Usage:  1> Inquire
  5. *   Author: Jeff Lavin
  6. *  History: 05/21/90 V1.00 Created
  7. *
  8. ******************************* tear here ***********************************
  9.  
  10. SYS    macro        ;General purpose macro
  11.     jsr    _LVO\1(a6)    ;Call the function
  12.     endm
  13.  
  14. STRUCTURE    macro
  15. \1    set    0
  16. SOFFSET    set    \2
  17.     endm
  18.  
  19. APTR    macro
  20. \1    equ    SOFFSET
  21. SOFFSET    set    SOFFSET+4
  22.     endm
  23.  
  24. BPTR    macro
  25. \1    equ    SOFFSET
  26. SOFFSET    set    SOFFSET+4
  27.     endm
  28.  
  29. LONG    macro
  30. \1    equ    SOFFSET
  31. SOFFSET    set    SOFFSET+4
  32.     endm
  33.  
  34. WORD    macro
  35. \1    equ    SOFFSET
  36. SOFFSET    set    SOFFSET+2
  37.     endm
  38.  
  39. BYTE    macro
  40. \1    equ    SOFFSET
  41. SOFFSET    set    SOFFSET+1
  42.     endm
  43.  
  44. STRUCT    macro
  45. \1    equ    SOFFSET
  46. SOFFSET    set    SOFFSET+\2
  47.     endm
  48.  
  49. LABEL    macro
  50. \1    equ    SOFFSET
  51.     endm
  52.  
  53. SysBase    equ    4    ;Exec library base pointer
  54.  
  55. cd_BoardAddr    equ    $20    ;ConfigDev Structure
  56.  
  57. * AutoConfig Board Equates
  58.  
  59. MANF_CLTD    equ    1004    ;Manufacturer number
  60. PROD_12    equ    12    ;Current product rev number
  61. PROD_14    equ    14    ;Earlier product rev number
  62. CLTD_HOST    equ    7    ;SCSI Unit number of Host Controller
  63.  
  64. * Class 00 SCSI Command Structure - (General form, specific commands vary)
  65.  
  66. sc_cmd    equ    0    ;Command OpCode
  67. sc_adrH    equ    1    ;Logical Block Address (MSB)
  68. sc_adrM    equ    2    ;Logical Block Address
  69. sc_adrL    equ    3    ;Logical Block Address (LSB)
  70. sc_count    equ    4    ;Block Count
  71. sc_reserv    equ    5    ;Reserved
  72.  
  73. * NCR5380 SCSI Host Controller registers  - Offset = ([reg] * 2) + 1
  74. * ------------------------------------------------------------------
  75. ncr_data    equ    $01    ;(0) Current SCSI Data           (R)
  76.             ;    Output Data                 (W)
  77. ncr_icmd    equ    $03    ;(1) Initiator Command           (R/W)
  78. ncr_mode    equ    $05    ;(2) Mode                        (R/W)
  79. ncr_tcmd    equ    $07    ;(3) Target Command              (R/W)
  80. ncr_bstat    equ    $09    ;(4) Current SCSI Bus Status     (R)
  81.             ;    Select Enable               (W)
  82. ncr_stat    equ    $0B    ;(5) Bus and Status              (R)
  83.             ;    Start DMA Send              (W)
  84. ncr_input    equ    $0D    ;(6) Input Data                  (R)
  85.             ;    Start DMA Target Receive    (W)
  86. ncr_reset    equ    $0F    ;(7) Reset Parity/Interrupts     (R)
  87.             ;    Start DMA Initiator Receive (W)
  88. * SCSI Command OpCodes
  89.  
  90. REQ_SENSE    equ    $03
  91. INQUIRE    equ    $12
  92.  
  93. * Equates for Initiator Command Register (1)
  94.  
  95. ASS_NOT    equ    %00000000    ;Assert nothing, i.e., free data bus
  96. ASS_BUS    equ    %00000001    ;Assert Data Bus
  97. ASS_ATN    equ    %00000010    ;Assert Attention
  98. ASS_SEL    equ    %00000100    ;Assert Select
  99. ASS_BSY    equ    %00001000    ;Assert Busy
  100. ASS_ACK    equ    %00010000    ;Assert Acknowledge
  101. ASS_RST    equ    %10000000    ;Assert Reset
  102.  
  103. * Equates for Mode Register (2)
  104.  
  105. ARBITRATE    equ    0    ;Start arbitration
  106. MONITOR_BSY    equ    2    ;Generate busy lost interrupt
  107.  
  108. * SCSI Information Transfer Phases (for Target Command Register (3))
  109.  
  110. ASS_IO    equ    %00000001    ;Assert I/O
  111. ASS_CD    equ    %00000010    ;Assert C/D
  112. ASS_MSG    equ    %00000100    ;Assert MSG
  113.  
  114. PH_DOUT    equ    0    ;Data Out Phase
  115. PH_DIN    equ    ASS_IO    ;Data In Phase
  116. PH_CMD    equ    ASS_CD    ;Command Phase
  117. PH_STAT    equ    ASS_IO!ASS_CD    ;Status Phase
  118. PH_MOUT    equ    ASS_CD!ASS_MSG    ;Message Out Phase
  119. PH_MIN    equ    ASS_IO!ASS_CD!ASS_MSG ;Message In Phase
  120.  
  121. * Bit defs for Bus Status Register (4)
  122.  
  123. BCBS_DBP    equ    0    ;Data Bus Parity Status
  124. BCBS_SEL    equ    1    ;Select Phase Status
  125. BCBS_IO    equ    2    ;I/O Direction
  126. BCBS_CD    equ    3    ;Control / Data Status
  127. BCBS_MSG    equ    4    ;Message Phase
  128. BCBS_REQ    equ    5    ;Data Request Status
  129. BCBS_BSY    equ    6    ;SCSI Bus Busy Status
  130. BCBS_RST    equ    7    ;SCSI Bus Reset Status
  131.  
  132. * Equates for Status Register (5)
  133.  
  134. PHAS_MATCH    equ    3    ;Phase match bit def
  135. INT_REQ    equ    4    ;Interrupt request bit def
  136. DMA_REQ    equ    6    ;DMA request bit def
  137.  
  138. * Program variables
  139.  
  140.                STRUCTURE    WorkArea,0
  141.     APTR    InitialSP
  142.     APTR    DosBase
  143.     APTR    ExpBase
  144.     BPTR    stdout
  145.     WORD    Error    ;Offset into error msg table
  146.     WORD    Device    ;SCSI Device number
  147.     STRUCT    FmtArgs,4*4    ;Format args
  148.     STRUCT    SCSICmd,10    ;SCSI Command structure
  149.     STRUCT    OutBuf,80    ;Output buffer
  150.     STRUCT    DataBuf,512    ;Read data buffer
  151.     LABEL    Work_Sizeof
  152.  
  153. _LVODisable    equ    -$78
  154. _LVOEnable    equ    -$7E
  155. _LVOCloseLibrary    equ    -$19E
  156. _LVORawDoFmt    equ    -$20A
  157. _LVOOpenLibrary    equ    -$228
  158.  
  159. _LVOWrite    equ    -$30
  160. _LVOOutput    equ    -$3C
  161.  
  162. _LVOFindConfigDev    equ    -$48
  163.  
  164.     errfile    'ram:assem.output'
  165.     exeobj
  166.     objfile    'Inquire'
  167.  
  168. Inquire    lea    DT(pc),a5
  169.     movea.l    a5,a1    ;Clear BSS section
  170.     move.w    #(Work_Sizeof/4)-1,d1
  171. 1$    clr.l    (a1)+
  172.     dbra    d1,1$
  173.  
  174.     move.l    d0,d2    ;Save cmd line
  175.     movea.l    a0,a2
  176.     move.l    sp,InitialSP(a5)
  177.  
  178.     movea.l    SysBase,a6
  179.     lea    DosName(pc),a1
  180.     moveq    #0,d0
  181.     SYS    OpenLibrary    ;Open dos.library
  182.     move.l    d0,DosBase(a5)
  183.     beq    Exit
  184.  
  185.     movea.l    d0,a6
  186.     SYS    Output
  187.     move.l    d0,stdout(a5)
  188.     beq    Cleanup
  189.  
  190.     lea    BannerStr(pc),a0
  191.     bsr    Puts
  192.  
  193.     clr.b    -1(a2,d2.w)    ;Null terminate cmd line
  194.  
  195. 2$    move.b    (a2)+,d0
  196.     beq.s    3$    ;No args
  197.     cmpi.b    #' ',d0    ;Skip spaces
  198.     beq.s    2$
  199.     cmpi.b    #'?',d0    ;Instruct?
  200.     beq    Instruct    ;"Usage:..."
  201.  
  202. 3$    movea.l    SysBase,a6
  203.     lea    ExpName(pc),a1    ;Open expansion.library
  204.     moveq    #0,d0    ;Any version
  205.     SYS    OpenLibrary
  206.     move.l    d0,ExpBase(a5)
  207.     beq    Error1
  208.  
  209.     movea.l    d0,a6
  210.     suba.l    a0,a0
  211.     move.l    #1004,d3
  212.     moveq    #14,d2
  213.     move.l    d3,d0
  214.     move.l    d2,d1
  215.     SYS    FindConfigDev
  216.     tst.l    d0
  217.     bne.s    4$
  218.  
  219.     suba.l    a0,a0
  220.     move.l    d3,d0
  221.     moveq    #12,d2
  222.     move.l    d2,d1
  223.     SYS    FindConfigDev
  224.     tst.l    d0
  225.     beq    Error2
  226. 4$    movea.l    d0,a4    ;Ptr to ConfigDev structure
  227.     movea.l    cd_BoardAddr(a4),a4
  228.  
  229.     movea.l    a6,a1
  230.     movea.l    SysBase,a6
  231.     SYS    CloseLibrary
  232.     clr.l    ExpBase(a5)
  233.  
  234. MainLoop    move.b    Device(a5),d1
  235.     bsr    GenCmd    ;Generate the SCSI command
  236.     beq    6$    ;Bad return, try next
  237.  
  238.     lea    SCSICmd(a5),a3    ;Build our SCSI command
  239.     movea.l    a3,a0
  240.     move.b    #REQ_SENSE,(a0)+    ;Bit 0-4 = OpCode
  241.     clr.b    (a0)+    ;Bit 5-7 = Logical unit number
  242.     clr.b    (a0)+    ; Not used for this command
  243.     clr.b    (a0)+    ; Not used for this command
  244.     move.b    #16,(a0)+    ;Length
  245.     clr.b    (a0)    ; Not used for this command
  246.     bsr    ScsiOutCmd    ;Send the SCSI command
  247.  
  248.     lea    DataBuf(a5),a2
  249.     bsr    GetData
  250.     bsr    SCSIStat
  251.     tst.b    d0
  252.     bne.s    1$
  253.  
  254.     lea    FmtArgs(a5),a1
  255.     moveq    #0,d0
  256.     move.b    Device(a5),d0
  257.     move.w    d0,(a1)
  258.     lea    FoundUnit.fmt(pc),a0    ;"Unit #%d is Present"
  259.     bsr    Printf
  260.     bra.s    2$
  261.  
  262. 1$    lea    SenseErr.msg(pc),a0    ;"Request Sense Error"
  263.     bsr    Puts
  264.  
  265. 2$    move.b    Device(a5),d1
  266.     bsr    GenCmd    ;Generate the SCSI command
  267.     beq    6$    ;Bad return, try next
  268.  
  269.     lea    SCSICmd(a5),a3    ;Build our SCSI command
  270.     movea.l    a3,a0
  271.     move.b    #INQUIRE,(a0)+    ;Bit 0-4 = OpCode
  272.     clr.b    (a0)+    ;Bit 5-7 = Logical unit number
  273.     clr.b    (a0)+    ; Not used for this command
  274.     clr.b    (a0)+    ; Not used for this command
  275.     move.b    #35,(a0)+    ;Length
  276.     clr.b    (a0)    ; Not used for this command
  277.     bsr    ScsiOutCmd    ;Send the SCSI command
  278.  
  279.     lea    DataBuf(a5),a2
  280.     bsr    GetData
  281.     bsr    SCSIStat
  282.     tst.b    d0
  283.     bne.s    4$
  284.     lea    DataBuf(a5),a2
  285.     addq.w    #6,a2    ;Start at 6th byte
  286.     moveq    #26-1,d2    ;Print 26 bytes
  287.  
  288. 3$    lea    FmtArgs(a5),a1
  289.     moveq    #0,d0
  290.     move.b    (a2)+,(a1)
  291.     lea    c.fmt(pc),a0
  292.     bsr    Printf
  293.     dbra    d2,3$
  294.  
  295.     lea    NewLine(pc),a0
  296.     bra.s    5$
  297.  
  298. 4$    lea    NoData.msg(pc),a0    ;"Inquiry data unavailable"
  299. 5$    bsr    Puts
  300. 6$    addq.b    #1,Device(a5)
  301.     cmp.b    #8,Device(a5)
  302.     bcs    MainLoop
  303.     lea    Done.msg(pc),a0
  304.     bsr    Puts
  305.     bra.s    Cleanup
  306.  
  307. Error2    addq.w    #4,Error(a5)    ;"NO CLtd Controller Found"
  308. Error1    addq.w    #4,Error(a5)    ;"Couldn't open expansion.library"
  309. Instruct    bsr    ReportError    ;"Usage: 1> Inquire"
  310. Cleanup    movea.l    SysBase,a6
  311.     move.l    ExpBase(a5),d0
  312.     beq.s    1$
  313.     movea.l    d0,a1
  314.     SYS    CloseLibrary
  315.  
  316. 1$    move.l    DosBase(a5),d0
  317.     beq.s    Exit
  318.     movea.l    d0,a1
  319.     SYS    CloseLibrary
  320.  
  321. Exit    move.l    InitialSP(a5),sp
  322.     moveq    #0,d0
  323.     rts
  324.  
  325. ********************************************************************
  326. * NAME:     GenCmd()
  327. * FUNCTION: Setup SCSI bus for command phase & generate a class 00
  328. *           SCSI command.
  329. * INPUTS:   D1 = SCSI Device number
  330. *           A4 = NCR5380 base address
  331. * RETURN:   D0 = 0 if successful, or error code.
  332. * SCRATCH:  None
  333. ********************************************************************
  334.  
  335. GenCmd    move.l    #$40000,d0
  336. 1$    btst    #BCBS_BSY,ncr_bstat(a4)    ;Wait for free bus
  337.     beq.s    2$        ;If this doesn't happen after a
  338.     subq.l    #1,d0        ; while, exit (rather than hang).
  339.     bmi.s    4$
  340.     bpl.s    1$
  341. 2$    move.b    #PH_DOUT,ncr_tcmd(a4)    ;Setup 'Data Out' bus phase
  342.     moveq    #1,d0        ;Wait 1 bus settle delay
  343.     lsl.b    d1,d0        ;Shift device ID to a bit number
  344.     bset.b    #CLTD_HOST,d0        ;OR with ID of Host Controller
  345.     move.b    d0,ncr_data(a4)        ;Place ID on the data bus
  346.     nop            ;Wait 2 deskew delays
  347.     move.b    #ASS_BUS!ASS_SEL,ncr_icmd(a4) ;Assert select
  348.     move.l    #$40000,d0
  349. 3$    btst    #BCBS_BSY,ncr_bstat(a4)    ;Wait for target to respond
  350.     bne.s    5$        ; by asserting busy.
  351.     subq.l    #1,d0
  352.     bpl.s    3$        ;If this doesn't happen after a
  353. 4$    moveq    #0,d0        ; while, exit (rather than hang).
  354.     rts
  355.  
  356. 5$    nop            ;Wait 2 deskew delays
  357.     move.b    #ASS_NOT,ncr_icmd(a4)    ; and deassert select.
  358.     moveq    #1,d0
  359.     rts
  360.  
  361. *************************************************************************
  362. * NAME:     ScsiOutCmd()
  363. * FUNCTION: Send a class 00 command out the SCSI bus.
  364. * INPUTS:   A3 = Ptr to SCSICmd structure
  365. *           A4 = NCR5380 base address
  366. * RETURN:   None
  367. * SCRATCH:  None
  368. *************************************************************************
  369.  
  370. ScsiOutCmd    move.l    a3,-(sp)
  371.     tst.b    (a3)        ;If opcode 00 (Test Unit Ready),
  372.     beq.s    1$        ; go directly to Data Out phase.
  373.     move.b    #PH_CMD,ncr_tcmd(a4)    ;Else, setup 'Command' phase
  374.     bra.s    2$
  375. 1$    move.b    #PH_DOUT,ncr_tcmd(a4)    ;Setup 'Data Out' phase
  376.  
  377. 2$    move.b    #ASS_BUS,ncr_icmd(a4)    ;Assert the data bus
  378. 3$    btst    #BCBS_REQ,ncr_bstat(a4)    ;Wait for target to
  379.     beq.s    3$        ; assert Request.
  380.     btst    #PHAS_MATCH,ncr_stat(a4)    ;If we're not still in the
  381.     beq.s    5$        ; right phase, exit.
  382.     move.b    (a3)+,ncr_data(a4)    ;OK, send a byte of command
  383.     move.b    #ASS_BUS!ASS_ACK,ncr_icmd(a4) ;Send an ACK to target
  384. 4$    btst    #BCBS_REQ,ncr_bstat(a4)    ;Wait for target to
  385.     bne.s    4$        ; deassert Request.
  386.     move.b    #ASS_BUS,ncr_icmd(a4)    ;Reassert the data bus
  387.     bra.s    3$        ; and send the next byte.
  388.  
  389. 5$    move.b    #ASS_NOT,ncr_icmd(a4)    ;We got here because of a glitch
  390.     movea.l    (sp)+,a3        ; or we sent all the cmd bytes.
  391.     rts
  392.  
  393. *************************************************************************
  394. * NAME:     GetData()
  395. * FUNCTION: Do pseudo-DMA data transfer from SCSI bus.
  396. * INPUTS:   A2 = Data buffer.
  397. *           A4 = NCR5380 base address.
  398. * RETURN:   None
  399. * SCRATCH:  D0-D1/A0-A1
  400. *************************************************************************
  401.  
  402. GetData    move.l    a2,-(sp)
  403.     SYS    Disable
  404.     move.b    #PH_DIN,ncr_tcmd(a4)    ;Data In phase
  405. 1$    btst    #BCBS_REQ,ncr_bstat(a4)
  406.     beq.s    1$
  407.     btst    #PHAS_MATCH,ncr_stat(a4)
  408.     beq.s    11$
  409.  
  410.     move.b    #MONITOR_BSY,ncr_mode(a4)
  411.     move.b    #0,ncr_reset(a4)    ;Start DMA receive
  412.     move.b    #DMA_REQ,d1
  413.     lea    ncr_input(a4),a0
  414.     lea    ncr_stat(a4),a1
  415. 2$    btst    d1,(a1)
  416.     beq.s    3$
  417.     move.b    (a0),(a2)+
  418. 3$    btst    d1,(a1)
  419.     beq.s    4$
  420.     move.b    (a0),(a2)+
  421. 4$    btst    d1,(a1)
  422.     beq.s    5$
  423.     move.b    (a0),(a2)+
  424. 5$    btst    d1,(a1)
  425.     beq.s    6$
  426.     move.b    (a0),(a2)+
  427. 6$    btst    d1,(a1)
  428.     beq.s    7$
  429.     move.b    (a0),(a2)+
  430. 7$    btst    d1,(a1)
  431.     beq.s    8$
  432.     move.b    (a0),(a2)+
  433. 8$    btst    d1,(a1)
  434.     beq.s    9$
  435.     move.b    (a0),(a2)+
  436. 9$    btst    d1,(a1)
  437.     beq.s    10$
  438.     move.b    (a0),(a2)+
  439. 10$    btst    #INT_REQ,(a1)
  440.     beq.s    2$
  441.     move.b    #ARBITRATE,ncr_mode(a4)
  442.     tst.b    ncr_reset(a4)    ;Dummy read
  443. 11$    SYS    Enable
  444.     movea.l    (sp)+,a2
  445.     rts
  446.  
  447. *************************************************************************
  448. * NAME:     SCSIStat()
  449. * FUNCTION: Test the status of the SCSI bus.
  450. * INPUTS:   A4 = NCR5380 base address
  451. * RETURN:   D0 = Status
  452. * SCRATCH:  None
  453. *************************************************************************
  454.  
  455. SCSIStat    move.b    #PH_STAT,ncr_tcmd(a4)    ;Assert I/O and C/D
  456. 1$    btst    #BCBS_REQ,ncr_bstat(a4)    ;Wait for target to
  457.     beq.s    1$        ; assert Request.
  458.     moveq    #0,d0
  459.     move.b    ncr_data(a4),d0        ;Get status byte
  460.     move.b    #ASS_ACK,ncr_icmd(a4)    ;Send an ACK to target
  461. 2$    btst    #BCBS_REQ,ncr_bstat(a4)    ;Wait for target to
  462.     bne.s    2$        ; deassert Request.
  463.     move.b    #ASS_NOT,ncr_icmd(a4)    ;Drop bus
  464.     move.b    #PH_MIN,ncr_tcmd(a4)    ;Setup 'Message In' phase
  465. 3$    btst    #BCBS_REQ,ncr_bstat(a4)    ;Wait for target to
  466.     beq.s    3$        ; assert Request.
  467.     tst.b    ncr_data(a4)        ;Dummy read (expected)
  468.     move.b    #ASS_ACK,ncr_icmd(a4)    ;Send an ACK to target
  469. 4$    btst    #BCBS_REQ,ncr_bstat(a4)    ;Wait for target to
  470.     bne.s    4$        ; deassert Request.
  471.     move.b    #ASS_NOT,ncr_icmd(a4)    ;Drop bus
  472.     rts
  473.  
  474. *********************************************************************
  475. * NAME:     Printf()
  476. * FUNCTION: Print formatted strings to stdout.
  477. * INPUTS:   A0 = Format string.
  478. *           A1 = Ptr to arguments.
  479. * RETURN:   None
  480. * SCRATCH:  D0-D1/A0-A1
  481. *********************************************************************
  482.  
  483. Printf    movem.l    a2-a3/a6,-(sp)
  484.     lea    KPutChar(pc),a2    ;Byte fill routine
  485.     lea    OutBuf(a5),a3
  486.     move.l    a3,-(sp)
  487.     movea.l    SysBase,a6
  488.     SYS    RawDoFmt    ;Do it!
  489.     movea.l    (sp)+,a0
  490.     bsr.s    Puts
  491.     movem.l    (sp)+,a2-a3/a6
  492.     rts
  493.  
  494. KPutChar    move.b    d0,(a3)+
  495.     rts
  496.  
  497. *************************************************************************
  498. * NAME:     Puts()
  499. * FUNCTION: Writes a message to stdout.
  500. * INPUTS:   A0 = Ptr to message.
  501. * RETURN:   None
  502. * SCRATCH:  D0-D1/A0-A1
  503. *************************************************************************
  504.  
  505. Puts    movem.l    d2-d4/a6,-(sp)
  506.     move.l    stdout(a5),d4
  507.     bsr.s    WriteMsg
  508.     movem.l    (sp)+,d2-d4/a6
  509.     rts
  510.  
  511. *************************************************************************
  512. * NAME:     WriteMsg()
  513. * FUNCTION: Common subroutine used by FPrintf, Printf, and Puts.
  514. * INPUTS:   A0 = Ptr to message.
  515. *           D4 = FileHandle.
  516. * RETURN:   None
  517. * SCRATCH:  D0-D1/A0-A1
  518. *************************************************************************
  519.  
  520. WriteMsg    move.l    a0,d3
  521. 1$    tst.b    (a0)+
  522.     bne.s    1$
  523.     exg    a0,d3
  524.     sub.l    a0,d3
  525.     subq.l    #1,d3    ;Length
  526.     move.l    a0,d2    ;Buffer
  527.     move.l    d4,d1    ;FileHandle
  528.     movea.l    DosBase(a5),a6
  529.     SYS    Write
  530.     rts
  531.  
  532. *************************************************************************
  533. * NAME:     ReportError()
  534. * FUNCTION: Sends the appropriate error message to stdout.
  535. * INPUTS:   Error = Offset from ErrStr.tbl.
  536. * RETURN:   None
  537. * SCRATCH:  D0-D1/A0-A1
  538. *************************************************************************
  539.  
  540. ReportError    move.w    Error(a5),d0
  541.     movea.l    ErrStr.tbl(pc,d0.w),a0
  542.     bra.s    Puts
  543.  
  544. ErrStr.tbl    dl    Usage.msg
  545.     dl    Error1.msg
  546.     dl    Error2.msg
  547.  
  548. Usage.msg    db    'Usage: 1> Inquire',10
  549.     db    'Check for Devices on the SCSI bus.',10,0
  550. Error1.msg    db    'Couldn''t open expansion.library.',10,0
  551. Error2.msg    db    '** NO CLtd Controller Found **',10,0
  552.  
  553. BannerStr    db    'SCSI Inquire Program V1.0 - ©1990 by Jeff Lavin',10,10,0
  554. Checking.msg    db    'Checking for Devices on the SCSI bus...',10,0
  555. FoundUnit.fmt    db    'Unit #%d is Present ',0
  556. SenseErr.msg    db    'Request Sense Error',0
  557. c.fmt    db    '%c',0
  558. NoData.msg    db    '- Inquiry data unavailable'
  559. NewLine    db    10,0
  560. Done.msg    db    10,'Done',10,0
  561.  
  562. DosName    db    'dos.library',0
  563. ExpName    db    'expansion.library',0
  564.     cnop    0,4
  565.  
  566. DT    dx.b    Work_Sizeof
  567.  
  568.     end
  569.